package com.jiaai.cloud.base.util;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 请求头工具类
 * </p>
 *
 * @author 佳爱网络科技
 * @version V1.0
 * @title HttpHeaderUtils.java
 * @since 2017/8/1
 */
public class HttpHeaderUtils {
    private  final  static Logger log= LoggerFactory.getLogger(HttpHeaderUtils.class);

    public static String getUserId(){
        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletRequest request = attributes.getRequest();
        String userid=request.getHeader("userId");
        return  userid;
    }


}
